import request from "../util/request";

//登录
export const loginApi = async (sendData) => {
    return request.post('/auth/login', sendData);
}

//获取验证码
export const getValidateCodeApi = async (mobile) => {
    return request.get(`/services/uaa/api/send-validation-code/${mobile}`)
}

//用户注册
export const registerUserApi = async (sendData) => {
    return request.get(`/services/uaa/api/user/mobile-quick-login/${sendData.username}`, { params: sendData });
}


//根据用户id获取用户信息
export const getUserByIdApi = async (id) => {
    return request.get(`/services/uaa/api/query-users/${id}`);
}

export function getVrifyCodeImg() {
    return `http://extdata.sit.sf-express.com/portal-web-system/usermanage/defaultKaptcha?${Date.now()}`;
}

/**
 * 注册
 * @param {名称} namne
 * @param {邮箱} email
 * @param {验证码} code
 */
 export async function register(params) {
    return request.post('/portal-web-system/usermanage/register', params );
  }
  
  /**
 * 获取验证码
 * @param {手机} phone
 */
 export async function sendCode(params) {
    return request.get('/portal-web-system/sms/sendCode', { params } );
  }